package com.tang.plugin.template;

import com.tang.plugin.model.FileTreeDsl;

public class Template {

    public static final FileTreeDsl ANDROID_RES = new FileTreeDsl((n1) -> n1.dir("res", (n2) -> {
        n2.dir("drawable", null);
        n2.dir("layout", null);
        n2.dir("values", null);
    }));

    public static final FileTreeDsl ANDROID_TEST = new FileTreeDsl((n) -> n.dir("AndroidTest", null));

    public static final FileTreeDsl JUNIT_TEST = new FileTreeDsl((n) -> n.dir("Test", null));

    public static final FileTreeDsl EMPTY = new FileTreeDsl((n) -> {

    });

    public static final FileTreeDsl ANDROID_APP = new FileTreeDsl((n1) ->
            n1.placeHolder("MODULE_NAME", "app")
                    .placeHolder("PACKAGE_NAME", "com.example")
                    .fileTemplate("MainActivity.java", "Template MainActivity.java")
                    .fileTemplate("AndroidManifest.xml", "Template Manifest.xml")
                    .fileTemplate("build.gradle", "Template build.gradle")
                    .dir("${MODULE_NAME}", (n2) ->
                            n2.dir("src", (n3) ->
                                    n3.include(ANDROID_TEST).dir("main", (n4) -> n4.dir("java", (n5) ->
                                                    n5.dir("${PACKAGE_NAME}", (n6) ->
                                                            n6.dir("${MODULE_NAME}", (n7) ->
                                                                    n7.file("MainActivity.java")))
                                            ).include(ANDROID_RES).file("AndroidManifest.xml")
                                    ).include(JUNIT_TEST)
                            ).file(".gitignore").file("build.gradle").file("proguard-rules.pro")));

}
